package org.onvivals.module.pms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.onvivals.common.base.BaseEntity;

import java.io.Serial;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Schema(description = "激活码")
@Data
@TableName(value = "pms_code", autoResultMap = true)
public class PmsCode extends BaseEntity<PmsCode> {

	@Serial
	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
	@Schema(description = "ID")
	private Long id;

	@TableField(value = "code")
	@Schema(description = "激活码")
	private String code;

	/**
	 * 激活码状态 0未激活 1 已激活 2 已失效
	 */
	@TableField(value = "`status`")
	@Schema(description="激活码状态")
	private Integer status;


	/**
	 * 激活时间
	 */
	@TableField(value = "active_time")
	@Schema(description="激活时间")
	private Date activeTime;

	/**
	 * 用户ID
	 */
	@TableField(value = "user_id")
	@Schema(description="用户ID")
	private Long userId;

	/**
	 * 用户昵称
	 */
	@TableField(value = "user_name")
	@Schema(description="用户昵称")
	private String userName;



}
